<template>
	<view class="box">
		<view class="font_35 text_bold title">问题与意见</view>
		<view class="text_content bg_f5">
			<textarea class="font_31" placeholder="请填写10字以上的问题描述以便我们提供更好的帮助" placeholder-style="color: #acacac;"
				v-model="submit_info.content"></textarea>
		</view>
		<view class="text_num bg_f5">
			<input class="font_27" type="number" maxlength="11" placeholder="请输入您的手机号"
				placeholder-style="color: #7b7b7b;" v-model="submit_info.mobile" />
		</view>
		<view class="btn2" :class="{'active': !submit_info.content}" @click="get_sure">确认</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				port: 1,
				submit_info: {
					mobile: '',
					content: ''
				}
			}
		},
		onLoad(e) {
			if (e.type) {
				this.port = 2;
			}
		},
		methods: {
			get_sure() {
				if (!this.submit_info.content) return getApp().get_msg('请输入反馈内容');

				if (this.port == 2) {
					// 商家
					this.$http.post(this.$api.setFeedBack2, this.submit_info).then(res => {
						getApp().get_msg('提交成功');
						getApp().get_back();
					})
					return
				}

				this.$http.post(this.$api.setFeedBack, this.submit_info).then(res => {
					getApp().get_msg('提交成功');
					getApp().get_back();
				})
			}
		}
	}
</script>

<style lang="less">
	.title {
		margin: 31rpx 38rpx 35rpx;
	}

	.text_content {
		padding: 15rpx;
		margin: 0 35rpx 1px;

		textarea {
			width: 100%;
		}
	}

	.text_num {
		padding: 24rpx 38rpx;
		margin: 0 35rpx;
	}

	.btn2 {
		margin: 90rpx auto 50rpx;

		&.active {
			background: #D5D9D9;
			box-shadow: 0px 6px 12px #DDDDDD;
		}
	}
</style>
